import os
from typing import List


def get_all_files(file_path, is_yaml_switch=False) -> List:
    '''
    获取文件绝对路径
    :param file_path:
    :param is_yaml_switch:
    :return:
    '''
    file_list = []
    for root, dirs, files in os.walk(file_path):
        for file in files:
            path = os.path.join(root, file)
            if is_yaml_switch:
                if file.endswith('.yaml'):
                    file_list.append(path)
            else:
                file_list.append(path)
    return file_list
